home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 26
/
Cream of the Crop 26.iso
/
program
/
ddj0897.zip
/
DYN401.ZIP
/
class
/
objassoc.c
< prev
next >
Wrap
C/C++ Source or Header
|
1997-04-16
|
3KB
|
134 lines
/* Copyright (c) 1993-1996 Algorithms Corporation */
/* All rights reserved. */
/* This file automatically generated by dpp - do not edit */
#define DPP_STRATEGY 2
#define DPP_FASTWIDE 0
#define CLASS ObjectAssociation_c
#define ivType ObjectAssociation_iv_t
#include "generics.h"
object ObjectAssociation_c;
#line 26 "objassoc.c"
typedef struct _ObjectAssociation_iv_t {
object iValue;
} ObjectAssociation_iv_t;
#line 20 "objassoc.d"
cmeth objrtn ObjectAssociation_cm_gNewWithObjObj(object self, object key, object val)
{
object assoc;
ivType *iv;
ChkArgNul(key, 2);
ChkArgNul(val, 3);
assoc = oSuper(ObjectAssociation_c, gNewWithObj, self)(self, key);
iv = ivPtr(assoc);
iv->iValue = val;
return assoc;
}
imeth objrtn ObjectAssociation_im_gDeepCopy(object self)
{ ObjectAssociation_iv_t *iv = GetIVs(ObjectAssociation, self);
object nobj;
nobj = oSuper(ObjectAssociation_c, gDeepCopy, self)(self);
ivPtr(nobj)->iValue = iv->iValue ? gDeepCopy(iv->iValue) : NULL;
return nobj;
}
imeth objrtn ObjectAssociation_im_gValue(object self)
{ ObjectAssociation_iv_t *iv = GetIVs(ObjectAssociation, self);
return iv->iValue;
}
imeth objrtn ObjectAssociation_im_gChangeValue(object self, object value)
{ ObjectAssociation_iv_t *iv = GetIVs(ObjectAssociation, self);
object ret;
ChkArgNul(value, 2);
ret = iv->iValue;
iv->iValue = value;
return ret;
}
imeth objrtn ObjectAssociation_im_gDeepDispose(object self)
{ ObjectAssociation_iv_t *iv = GetIVs(ObjectAssociation, self);
if (iv->iValue)
gDeepDispose(iv->iValue);
return oSuper(ObjectAssociation_c, gDeepDispose, self)(self);
}
imeth objrtn ObjectAssociation_im_gStringRepValue(object self)
{ ObjectAssociation_iv_t *iv = GetIVs(ObjectAssociation, self);
object s, k, v;
k = gKey(self);
k = k ? gStringRepValue(k) : gNewWithStr(String,"(null)");
v = iv->iValue ? gStringRepValue(iv->iValue) : gNewWithStr(String,"(null)");
s = vBuild(String, "( ", k, ", ", v, " )", NULL);
gDispose(k);
gDispose(v);
return s;
}
#line 91 "objassoc.c"
objrtn ObjectAssociation_initialize(void)
{
static CRITICALSECTION cs;
static int volatile once = 0;
ENTERCRITICALSECTION(_CI_CS_);
if (!once) {
INITIALIZECRITICALSECTION(cs);
once = 1;
}
LEAVECRITICALSECTION(_CI_CS_);
ENTERCRITICALSECTION(cs);
if (ObjectAssociation_c) {
LEAVECRITICALSECTION(cs);
return ObjectAssociation_c;
}
INHIBIT_THREADER;
LookupKey_initialize();
if (ObjectAssociation_c) {
ENABLE_THREADER;
LEAVECRITICALSECTION(cs);
return ObjectAssociation_c;
}
ObjectAssociation_c = gNewClass(Class, "ObjectAssociation", sizeof(ObjectAssociation_iv_t), 0, LookupKey, END);
cMethodFor(ObjectAssociation, gNewWithObjObj, ObjectAssociation_cm_gNewWithObjObj);
iMethodFor(ObjectAssociation, gValue, ObjectAssociation_im_gValue);
iMethodFor(ObjectAssociation, gStringRepValue, ObjectAssociation_im_gStringRepValue);
iMethodFor(ObjectAssociation, gChangeValue, ObjectAssociation_im_gChangeValue);
iMethodFor(ObjectAssociation, gDeepDispose, ObjectAssociation_im_gDeepDispose);
iMethodFor(ObjectAssociation, gDeepCopy, ObjectAssociation_im_gDeepCopy);
ENABLE_THREADER;
LEAVECRITICALSECTION(cs);
return ObjectAssociation_c;
}